import 'package:flutter/material.dart';
import '../Model/post.dart';

class PostDetailDemo extends StatelessWidget {

  final Post post;
  const PostDetailDemo({
    @required this.post
  });
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('${post.title}'),
        elevation: 0.0,
      ),
      body: ListView(
        children: <Widget>[
          Column(
            children: [
              Image.network(
                post.imageUrl,
                fit: BoxFit.cover
              ),
              Container(
                padding: EdgeInsets.all(32.0),
                width: double.infinity,
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      '${post.title}',
                      style: Theme.of(context).textTheme.headline6
                    ),
                    Text(
                      '${post.author}',
                      style: Theme.of(context).textTheme.subtitle1
                    ),
                    SizedBox(height:32.0),
                    Text(
                      '${post.description}',
                      style: Theme.of(context).textTheme.bodyText1
                    ),
                  ],
                )
              )
            ],
          ),
        ]
      )
    );
  }
}